<?PHP
header("Expires: Thu, 17 May 2001 10:17:17 GMT");    // Date in the past
  	header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
	header ("Cache-Control: no-cache, must-revalidate");  // HTTP/1.1
	header ("Pragma: no-cache");                          // HTTP/1.0
	session_start();
	include 'connect.php';
	
	if (!isset($_SESSION['SESSION'])) require ( "session_init.php");
include 'connect.php';
if (isset($_POST))
{
  foreach ($_POST as $key => $value ){
	  print $key." ";
	  }echo '<br />';
}   
if (isset($_SESSION))
{
  foreach ($_SESSION as $key => $value ){
	  print $key."   ";
	  }
}   
	
	$by=$_SESSION['USERID'];     
	$from = $_POST['city'];	
	$deplc = $_POST['placeofpickup'];	   
	$dephr =$_POST['hr'];
	$depmin=$_POST['min'];
	$depmed =$_POST['med'];	
	$depday =$_POST['day'];
	$depmonth =$_POST['month'];
	$depyr =$_POST['yr'];	
	$capacity =$_POST['Numberoftravellers'];
	$to =$_POST['city1'];
	$destplc =$_POST['placeofdropoff'];
	$moreinfo =$_POST['moreinfo'];
	$vin=$_POST['vin'];
	if($to==$from)
{
	$query= "INSERT INTO `lift_offers`(`lift_by`, `lift_depplc`, `lift_depdst`, `lift_destdst`, `lift_numbofpsgr`, `lift_destplc`, `lift_cat`, `lift_postdate`, `carregno`, `carfrontpic`, `carsidepic`, `carrearpic`, `lift_dyofdep`, `lift_monofdep`, `lift_yrofdep`, `lift_hrofdep`, `lift_minofdep`, `lift_depam`, `lift_moreinfo`) VALUES ('$by','$deplc','$from','$to','$capacity','$destplc',0,NOW(),'$vin','','','','$depday','$depmonth','$depyr','$dephr','$depmin','$depmed','$moreinfo')";
    if (mysql_query($query)) 
	{				
		echo "You post was successfully sent ";
		header("Location:home.php");
		exit;
	}
	else
	{
		echo "<p>".mysql_error(). "<p>";
	}
}
else
{
	$query1="INSERT INTO `lift_offers`(`lift_by`, `lift_depplc`, `lift_depdst`, `lift_destdst`, `lift_numbofpsgr`, `lift_destplc`, `lift_cat`, `lift_postdate`, `carregno`, `carfrontpic`, `carsidepic`, `carrearpic`, `lift_dyofdep`, `lift_monofdep`, `lift_yrofdep`, `lift_hrofdep`, `lift_minofdep`, `lift_depam`, `lift_moreinfo`) VALUES ('$by','$deplc','$from','$to','$capacity','$destplc',1,NOW(),'$vin','','','','$depday','$depmonth','$depyr','$dephr','$depmin','$depmed','$moreinfo')";
    if (mysql_query($query1)) 
	{				
		echo "You post was successfully sent <br />";
		header("Location:home.php");
		exit;
	}
	else
	{
		echo "<p>".mysql_error(). "<p>";
	}	
}		
	include 'close_connect.php';
	
?>